<%@ page language="java" contentType="text/html;charset=UTF-8"%>
<%@ include file="/commons/taglibs.jsp"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title></title>
<link href="${ctx}/styles/listTable.css" rel="stylesheet" type="text/css">
<script language="JavaScript" type="text/javascript" src="${ctx}/scripts/public.js"></script>
<script language="JavaScript" type="text/javascript" src="${ctx}/scripts/global.js"></script>
<script language="JavaScript" type="text/javascript" src="${ctx}/scripts/common.js"></script>
<script language="JavaScript" type="text/javascript" src="${ctx}/scripts/div/common.js"></script>
<script type="text/javascript" src="${ctx}/scripts/common/prototype.js"></script>
<script language="JavaScript" type="text/javascript" src="${ctx}/scripts/ajaxException.js"></script>

<script type="text/javascript">
	var currentId = "";
	function openAdd(){
		var url = "${ctx}/charge_preparePaySchemeAction.do?method=initAdd";
		top.windowOpen(url, "preparePaySchemeAdd", "${key.charege_scheme_add}", 700, 800,true,"PreparePaySchemeAddFrame");
	}

	function openEdit(){
		if(!checkCurrentId(true))return;
		var url = "${ctx}/charge_preparePaySchemeAction.do?method=initEdit&prePaySchId=" + currentId;
		currentId = null;
		window.frames("paySchemeFrame").clearSelectStatus();
		top.windowOpen(url, "preparePaySchemeEdit", "${key.charege_scheme_edit}", 700, 800,true,"PreparePaySchemeEditFrame");
	}

	function openDelete(){
		if(!checkCurrentId()) return;
		AskConfirm("${key.tipsByDeleteConfirm}","main","deleteOpt");
	}
	/**
	*   执行删除动作
	*/
	function deleteOpt(){
		var url = "${ctx}/charge_preparePaySchemeAction.do?method=delete";
		var param="prePaySchId=" + currentId;
		new Ajax.Request(url,
	                    {method: 'post', parameters: param, onComplete: function(result){
	                    		ajaxSubmitException(result.responseText);
	                    		flushFrame();
	                    		currentId = null;
	                    		window.frames("paySchemeFrame").clearSelectStatus();
	                    }}
	                    );
	}
	function openSearch(schemeName){
		window.frames("paySchemeFrame").setSchemeName(schemeName);
		flushFrame();
	}
	/**
	* flag 标识是否清除查询条件
	*/
	function flushFrame(flag){
		if(flag) schemeName.value = "";
		var url = "${ctx}/charge_preparePaySchemeAction.do?method=list&schemeName=" + schemeName.value;
		url = encodeURI(encodeURI(url));
		window.frames("paySchemeFrame").location = url;
	}

	function checkCurrentId(isEdit){
		var flag = true;
		if(currentId == null) flag =  false;
		if(currentId == "") flag =  false;
		if(!flag){
			if(isEdit)
				Alert("${key.tipsByModify}");
			else
				Alert("${key.tipsByDelete}");
		}
		return flag;
	}
</script>
</head>
<body onKeyDown="CommonKey()";oncontextmenu="return HideContextMenu_right()">
<div class="pageNav_bg">
  <table width="100%" border="0" cellspacing="0" cellpadding="0">
    <tr>
      <td id="pageNav_leftimg"><img src="${ctx}/images/ico_fc_yujiaofaan.gif" width="46" height="47"/></td>
      <td id="navWord"><span class="page_title">${key.charege_scheme}</span></td>
      <td class="pageNav_right"><a href="javascript:showFull_in();"><img id="full_image"  src="${ctx}/images/ico_fullscreen.gif" border="0"/></a></td>
    </tr>
  </table>
</div>
<div class="container">
  <table width="100%" border="0" cellpadding="0" cellspacing="0">
    <tr>
      <td>
          <table width="100%" border="0" cellpadding="0" cellspacing="0" id="search01" class="bg_search" >
            <tr>
              <td >
	              	<table border="0" cellpadding="0" cellspacing="1">
	                  <tr>
	                    <td class="td_search">${key.charege_scheme_name}：</td>
	                    <td class="td_search"><input name="schemeName" type="text" class="inputtext" maxlength="50" size="16" /></td>
	                    <td class="td_search">
		                    <table border="0" cellpadding="0" cellspacing="0" >
		                        <tr>
		                          <td class="buttonOffLeft" id="btn1_11"></td>
		                          <td class="buttonOffMiddle" id="btn1_12" onclick="openSearch(schemeName.value);" onblur="btn_change(1)" onMouseOver="btn_change_over(1)" onMouseOut="btn_change_out(1)">
		                          		<img src="${ctx}/images/ico_searchico.gif" alt="" border="0" align="absmiddle" /> ${key.search}
		                          </td>
		                          <td class="buttonOffRight" id="btn1_13"></td>
		                        </tr>
		                    </table>
	                    </td>
	                  </tr>
	              	</table>
              </td>
            </tr>
          </table>
    </tr>
    <tr>
      <td class="bg_toolBar">
      	<table width="100%" border="0" cellspacing="0" cellpadding="0">
	        <tr>
	          <td width="65%">&nbsp;</td>
	          <td width="35%" align="right">
				  <table border="0" cellpadding="0" cellspacing="0" id="ico2" style="display:show">
		            <tr>
		            <pms:AuthTag authName="charge_preparePaySchemeAction.do?method=initAdd">
		              <td class="toolbarico"><a href="#"  onClick="openAdd();" onFocus="this.blur()"><img src="${ctx}/images/ico_newfile.gif" border="0" align="absbottom" alt="${key.add}"/></a></td>
					 </pms:AuthTag>
					 <pms:AuthTag authName="charge_preparePaySchemeAction.do?method=initEdit">
					  <td class="toolbarico"><a href="#"  onClick="openEdit();"  onfocus="this.blur()"><img src="${ctx}/images/ico_amend.gif" border="0" align="absbottom" alt="${key.modify}"/></a></td>
					 </pms:AuthTag>
					 <pms:AuthTag authName="charge_preparePaySchemeAction.do?method=delete">
					  <td class="toolbarico"><a href="#" onClick="openDelete();" onFocus="this.blur()"><img src="${ctx}/images/ico_delete.gif" alt="${key.delete}" width="16" height="16" border="0" align="absbottom"></a></td>
					</pms:AuthTag>
					</tr>

		          </table>
			  </td>
        	</tr>
      	</table>
      </td>
    </tr>
    <tr>
		<td>
			<iframe id="paySchemeFrame" src="${ctx}/charge_preparePaySchemeAction.do?method=initList"  frameborder="0" border="0"  width="100%"></iframe>
		</td>
	</tr>
	</table>
</div>
</body>
</html>
